package com.linkage.event.pojo.dao;

import com.linkage.event.pojo.entity.EventMessage;
import com.linkage.event.pojo.entity.EventTask;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Component
@Mapper
public interface EventMessageMapper {
    int deleteByPrimaryKey(String id);

    int insert(EventMessage record);

    int insertSelective(EventMessage record);

    EventMessage selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(EventMessage record);

    int updateByPrimaryKey(EventMessage record);

    List<EventMessage> selectByEventList(@Param("message") EventMessage message, @Param("endDate") Date endDate,@Param("users")List<String> users,@Param("flag") Integer flag);

    List<Map<String,Object>> statisticEventCountByType(@Param("dptCode") String dptCode,@Param("status")String status);

    List<Map<String,Object>> statisticEventCountByStatus(@Param("dptCode") String dptCode);

    List<Map<String,Object>> statisticEventCountByRole(@Param("personClass") String personClass,@Param("dptCode")String dptCode,@Param("startTime") String startTime,@Param("endTime") String endTime);

    List<EventMessage> selectByUserCode(EventMessage eventMessage);

    List<EventMessage> selectMyEvents(@Param("eventTask") EventTask eventTask, @Param("eventDisposeStatus") String eventDisposeStatus, @Param("flag") String flag);
}